home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / _fixdfsi.s < prev    next >
Text File  |  1991-09-24  |  903b  |  42 lines

  1. # single precision floating point stuff for Atari-gcc using the SFP004
  2. # developed with gas
  3. #
  4. #  double float to long conversion routine
  5. #
  6. # M. Ritzert (mjr at dmzrzu71)
  7. #
  8. # 4.10.1990
  9. #
  10. # no oflow checking implemented since the 68881 treats this situation "correct",
  11. # i.e. according to IEEE. it returns MAXINT = 0x7fffffff and proceeds.
  12.  
  13. # addresses of the 68881 data port. This choice is fastest when much data is
  14. # transferred between the two processors.
  15.  
  16. comm =     -6
  17. resp =    -16
  18. zahl =      0
  19.  
  20. # waiting loop ...
  21. #
  22. # wait:
  23. # ww:    cmpiw    #0x8900,a0@(resp)
  24. #     beq    ww
  25. # is coded directly by
  26. #    .long    0x0c688900, 0xfff067f8
  27.     .text
  28.     .even
  29.     .globl    __fixdfsi, ___fixdfsi
  30. __fixdfsi:
  31. ___fixdfsi:
  32.     lea    0xfffa50,a0
  33.     movew    #0x5403,a0@(comm)    | fintrz to fp0
  34.     cmpiw    #0x8900,a0@(resp)    | check
  35.     movel    a7@(4),a0@
  36.     movel    a7@(8),a0@
  37.     movew    #0x6000,a0@(comm)    | result to d0
  38.     .long    0x0c688900, 0xfff067f8
  39.     movel    a0@,d0
  40.      rts
  41.         
  42.